package com.zheng.study.company.service;

import com.zheng.study.base.bean.Result;
import com.zheng.study.base.bean.search.order.Order;
import com.zheng.study.base.bean.search.page.PagePaging;
import com.zheng.study.base.bean.search.result.SearchResultPaging;
import com.zheng.study.base.bean.search.rule.Rule;
import com.zheng.study.base.service.BaseService;
import com.zheng.study.company.entity.Department;
import com.zheng.study.company.entity.Duty;
import com.zheng.study.company.entity.Power;
import com.zheng.study.company.entity.User;

import java.util.List;

/**
 * newFile
 * ============================================================================
 * author : dzw
 * createDate:  2018/11/13 。
 * ============================================================================
 */
public interface DutyService extends BaseService<Duty, String> {

	/**
	 * 分页 职责列表
	 */
	SearchResultPaging getDutyPageByDept(PagePaging page, List<Rule> rules, Order order, Department department);

	/**
	 * 获取用户拥有的职责列表
	 */
	List<Duty> getUserDutyList(User user);

	/**
	 * 设置更新用户的职责列表
	 * @param user 要进行操作的用户
	 * @param powerList 新的职责列表
	 */
	Result saveUserDutyList(User user, List<Power> powerList);

	/**
	 * 通过user和power获取duty
	 */
	Duty getDutyByUserAndPower(User user, Power power);

}
